package com.yanqu.road.entity.activity.snowgarden;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.date.DateHelper;

@FieldTypeAnnotation(tableName = "t_u_activity_snow_garden_relation", desc = "冰雪关系数据")
public class UserSnowGardenVisitRelation extends DataObject {
    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;
    @FieldTypeAnnotation(select = true, update = true, desc = "用户id")
    private long userId;

    @FieldTypeAnnotation(select = true, update = true, desc = "对方用户id")
    private long targetUserId;
    @FieldTypeAnnotation(desc = "第一阶段被对方协助次数")
    private int helpMeCount;
    @FieldTypeAnnotation(desc = "第一阶段协助对方次数")
    private int helpHerCount;
    @FieldTypeAnnotation(desc = "第二阶段被对方协助次数")
    private int helpMeCount2;
    @FieldTypeAnnotation(desc = "第二阶段协助对方次数")
    private int helpHerCount2;
    @FieldTypeAnnotation(desc = "最近的被协助时间")
    private long helpMeTime;
    @FieldTypeAnnotation(desc = "最近的协助时间")
    private long helpHerTime;

    public UserSnowGardenVisitRelation() {
    }

    public UserSnowGardenVisitRelation(int activityId, long userId, long targetUserId) {
        this.activityId = activityId;
        this.userId = userId;
        this.targetUserId = targetUserId;
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getTargetUserId() {
        return targetUserId;
    }

    public void setTargetUserId(long targetUserId) {
        this.targetUserId = targetUserId;
    }

    public int getHelpMeCount() {
        return helpMeCount;
    }

    public void setHelpMeCount(int helpMeCount) {
        this.helpMeCount = helpMeCount;
        setUpdateOption();
    }

    public int getHelpHerCount() {
        return helpHerCount;
    }

    public void setHelpHerCount(int helpHerCount) {
        this.helpHerCount = helpHerCount;
        setUpdateOption();
    }

    public long getHelpMeTime() {
        return helpMeTime;
    }

    public void setHelpMeTime(long helpMeTime) {
        this.helpMeTime = helpMeTime;
        setUpdateOption();
    }

    public long getHelpHerTime() {
        return helpHerTime;
    }

    public void setHelpHerTime(long helpHerTime) {
        this.helpHerTime = helpHerTime;
        setUpdateOption();
    }

    public int getHelpMeCount2() {
        return helpMeCount2;
    }

    public void setHelpMeCount2(int helpMeCount2) {
        this.helpMeCount2 = helpMeCount2;
    }

    public int getHelpHerCount2() {
        return helpHerCount2;
    }

    public void setHelpHerCount2(int helpHerCount2) {
        this.helpHerCount2 = helpHerCount2;
    }

    public void addHelpMeCount(int period, int count) {
        if (period == 1) {
            helpMeCount += count;
        } else if (period == 2) {
            helpHerCount2 += count;
        }
        this.helpMeTime = DateHelper.getCurrentTime();

        setUpdateOption();
    }

    public void addHelpHerCount(int period, int count) {
        if (period == 1) {
            helpHerCount += count;
        } else if (period == 2) {
            helpHerCount += count;
        }
        this.helpHerTime = DateHelper.getCurrentTime();
        setUpdateOption();
    }

    private int tempHelpMeCount;
    private int tempHelpHerCount;
    private int tempHelpMeCount2;
    private int tempHelpHerCount2;
    private long tempHelpMeTime;
    private long tempHelpHerTime;

    public int getTempHelpMeCount() {
        return tempHelpMeCount;
    }

    public void setTempHelpMeCount(int tempHelpMeCount) {
        this.tempHelpMeCount = tempHelpMeCount;
    }

    public int getTempHelpHerCount() {
        return tempHelpHerCount;
    }

    public void setTempHelpHerCount(int tempHelpHerCount) {
        this.tempHelpHerCount = tempHelpHerCount;
    }

    public int getTempHelpMeCount2() {
        return tempHelpMeCount2;
    }

    public void setTempHelpMeCount2(int tempHelpMeCount2) {
        this.tempHelpMeCount2 = tempHelpMeCount2;
    }

    public int getTempHelpHerCount2() {
        return tempHelpHerCount2;
    }

    public void setTempHelpHerCount2(int tempHelpHerCount2) {
        this.tempHelpHerCount2 = tempHelpHerCount2;
    }

    public long getTempHelpMeTime() {
        return tempHelpMeTime;
    }

    public void setTempHelpMeTime(long tempHelpMeTime) {
        this.tempHelpMeTime = tempHelpMeTime;
    }

    public long getTempHelpHerTime() {
        return tempHelpHerTime;
    }

    public void setTempHelpHerTime(long tempHelpHerTime) {
        this.tempHelpHerTime = tempHelpHerTime;
    }
}
